const {DataTypes} =  require('sequelize');
const sequelizeObj = require('./sequelizeObj')
const typeModel = require('./typeModel')

const shopModel = sequelizeObj.define(
    'shoplist',
    {
        id:{
            type:DataTypes.INTEGER,
            primaryKey:true,
            autoIncrement:true
        },
        shopName:{
            type:DataTypes.STRING,
            field:'shopName'
        },
        path:{
            type:DataTypes.STRING,
            field:'path'
        },
        type:{
            type:DataTypes.INTEGER,
            field:'type'
        },
        price:{
            type:DataTypes.FLOAT,
            field:'price'  
        }
    }
);

shopModel.belongsTo(typeModel,{
    foreignKey:'type',
    targetKey:'id'
})

module.exports =shopModel